/*
 * @Date: 2024-08-01 15:45:51
 * @Author: LiSong
 * @LastEditors: LiSong
 * @LastEditTime: 2024-10-24 15:10:21
 * @Description: ace编辑器自动提示配置
 */

/**
 * 属性说明
 * 
 * meta: 元标识，标识该API是用于哪里
 * caption: API的提示内容
 * value: API被选中后回显的值
 * score: 级别数字越大，权重越高
 */
export const aceAutoTips = []
export const completions = [
  {
    type: 'common',
    meta: 'VForm API',
    score: 2,
    captions: [
      { value: 'getFormRef' },
      { value: 'getWidgetRef' },
      { value: 'formRenderDispatchEmit' },
    ]
  },
  {
    type: 'widget',
    meta: 'Widget API',
    score: 3,
    captions: [
      { value: 'getValue' },
      { value: 'setValue' },
      { value: 'setHidden' },
      { value: 'setReadonly' },
      { value: 'setRequired' },
      { value: 'setDisabled' },
    ]
  },
  {
    type: 'dataTable',
    meta: 'DataTable API',
    score: 3,
    captions: [
      { value: 'handleSearch' },
      { value: 'getTableData' },
      { value: 'setTableTitle' },
      { value: 'loadTableData' },
      { value: 'getRadioRecord' },
      { value: 'getCheckboxRecords' },
      { value: 'setTableColumnHidden' },
    ]
  },
  {

    type: 'selectWidget',
    meta: 'SelectWidget API',
    score: 3,
    captions: [
      { value: 'loadOptionsData' },
    ]
  },
  {
    type: 'busiConfig',
    meta: 'BusiConfig API',
    score: 2,
    captions: [
      { value: 'getUserInfo' },
      { value: 'getBjAdCode' },
      { value: 'getBusiConfig' },
      { value: 'getCurrentYear' },
    ]
  },
  {
    type: 'dialogConfig',
    meta: 'DialogConfig API',
    score: 3,
    captions: [
      { value: 'showDialog' },
    ]
  },
]
for (let item of completions) {
  for (let capItem of item.captions) {
    aceAutoTips.push({
      meta: item.meta,
      score: item.score,
      value: `${capItem.value}()`,
      caption: capItem.value
    })
  }
}
